package com.mszlu.news.admin.controller;

import com.mszlu.news.admin.model.params.AuthenticationParam;
import com.mszlu.news.admin.service.AuthenticationService;
import com.mszlu.news.admin.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "V认证接口")
@RestController
@RequestMapping("authentication")
public class AuthenticationController {
    @Autowired
    private AuthenticationService authenticationService;

    @ApiOperation(value = "增加认证")
    @PostMapping("add")
    public Result addAuthentication(@RequestBody AuthenticationParam authenticationParam){
        return authenticationService.addAuthentication(authenticationParam);
    }

    @ApiOperation(value = "获取所有认证申请")
    @PostMapping("select")
    public Result selectAuthentication(@RequestBody AuthenticationParam authenticationParam){
        return authenticationService.selectAuthentication(authenticationParam);
    }

    @ApiOperation(value = "通过认证申请")
    @PostMapping("admit")
    public Result admitAuthentication(@RequestBody AuthenticationParam authenticationParam){
        return authenticationService.admitAuthentication(authenticationParam);
    }

    @ApiOperation(value = "删除认证")
    @PostMapping("delete")
    public Result deleteAuthentication(@RequestBody AuthenticationParam authenticationParam){
        return authenticationService.deleteAuthentication(authenticationParam);
    }
}
